


$('#btn').on('click',function(){
    information()
})

$('.to').on('click',function(){
    location.href = '../index.html'
})


function information() {
    let token = localStorage.getItem('token')
    $.ajax({
        type: "PATCH",
        url: "http://localhost:8081/user",
        data: {
            "nickname": $('#ipt').val(),
        },
        headers:{
            'authorization':token
        },
        success: function (res) {
            if (res.status == 200 && $('#ipt').val() !== '') {
                $.alert("提示信息", res.description);
            }
        }
    });
}
